<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录页面</title>
<script src="${webroot}/resource/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function(){
		$("#btn_1").click(function(){
			var name = $("#name").val();
			var pass = $("#pass").val();
			if(name == null || name == '') {
				$("#error").text("用户名为空!");
			} else {
				if(pass == null || pass == '') {
					$("#error").text("密码为空!");
				} else {
					$.ajax({
						cache:true,
						type:"POST",
						url:"/login",
						data:$('#form_1').serialize(),
						async:false,
						success:function(data) {
							if(data.code == 1)
								$("#error").text(data.msg);
							else{
								$("#btn_1").val(data.msg);
								location.href="/main";
							}
						}
					});
				}
			}
		});
	})
</script>
<style>
body {
	background: #ebebeb;
	font-family: "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei",
		"\9ED1\4F53", Arial, sans-serif;
	color: #222;
	font-size: 12px;
}

* {
	padding: 0px;
	margin: 0px;
}

.top_div {
	background: #008ead;
	width: 100%;
	height: 360px;
}

.ipt {
	border: 1px solid #d3d3d3;
	padding: 10px 10px;
	width: 290px;
	border-radius: 4px;
	padding-left: 35px;
	-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
	box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
	-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow
		ease-in-out .15s;
	-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out
		.15s;
	transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s
}

.ipt:focus {
	border-color: #66afe9;
	outline: 0;
	-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px
		rgba(102, 175, 233, .6);
	box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px
		rgba(102, 175, 233, .6)
}

.u_logo {
	background: url("resource/imgs/username.png") no-repeat;
	padding: 10px 10px;
	position: absolute;
	top: 43px;
	left: 40px;
}

.p_logo {
	background: url("resource/imgs/password.png") no-repeat;
	padding: 10px 10px;
	position: absolute;
	top: 12px;
	left: 40px;
}

</style>


</head>
<body>
	<div class="top_div"></div>
	<form id="form_1" action="/login" method="post">
		<div
			style="background: rgb(255, 255, 255); margin: -100px auto auto; border: 1px solid rgb(231, 231, 231); border-image: none; width: 400px; height: 200px; text-align: center;">
			<div style="width: 165px; height: 96px; position: absolute;">
				<div class="tou"></div>
				<div class="initial_left_hand" id="left_hand"></div>
				<div class="initial_right_hand" id="right_hand"></div>
			</div>
			<P style="padding: 30px 0px 10px; position: relative;">
				<span class="u_logo"></span> <input class="ipt" type="text"
					id="name" name="username" placeholder="请输入用户名">
			</P>
			<P style="position: relative;">
				<span class="p_logo"></span> <input class="ipt" type="password"
					id="pass" name="password" placeholder="请输入密码">
			</P>
			<p style="pasition: relative">
				<span id="error" style="margin-left:31px;color:red;font-size:14px;float:left"></span>
			</p>
			<div
				style="height: 50px; line-height: 50px; margin-top: 30px; border-top-color: rgb(231, 231, 231); border-top-width: 1px; border-top-style: solid;">
				<P style="margin: 0px 35px 20px 45px;">
					<span style="float: right;"> <input id="btn_1" type="button"
						style="cursor: pointer; background: rgb(0, 142, 173); padding: 7px 10px; border-radius: 4px; border: 1px solid rgb(26, 117, 152); border-image: none; color: rgb(255, 255, 255); font-weight: bold;"
						value="登 录" >
					</span>
				</P>
			</div>
		</div>
		<!-- <div style="text-align: center;">
			<p>
			</p>
		</div> -->
	</form>
</body>
</html>
